<?php

namespace App\Http\Controllers\home;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class Search extends Common
{
    //
    public function index(Request $request)
    {
        $wd = trim($request->wd);
        $data['lst'] = DB::table('article')->where('title','like','%'.$wd.'%')->limit(20)->lists();
        $data['admin']   = DB::table('admin')->cates('id');
        $data['member'] = Auth::guard('member')->user();
        return view('home.search',$data);
    }
}
